Skip to content

feat(agent-skills): manage app agent skills from the CLI - #575

Merged
yardend-wix merged 19 commits into
mainfrom
feat/agent-skills-cli
Jul 30, 2026
Merged

feat(agent-skills): manage app agent skills from the CLI#575
yardend-wix merged 19 commits into
mainfrom
feat/agent-skills-cli

Conversation

@yardend-wix

@yardend-wix yardend-wix commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Note

Description

Adds agent skills as a first-class CLI resource. Agent skills are app-scoped instruction snippets stored as one markdown file per skill under base44/agent-skills/ (filename = skill name, front-matter description = summary, body = instructions), which agents reference by name through selected_skill_names. The PR introduces base44 agent-skills pull / push, wires skills into project config and the unified deploy flow (pushed before agents so references resolve), and scaffolds an example skill in the backend-and-client template.

Related Issue

None (push confirmation follows the agents-command parity established in #573)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

New agent-skill resource (packages/cli/src/core/resources/agent-skill/)

  • schema.ts — Zod schemas for skills (lowercase-hyphenated name, max 64 chars; description max 1024; body max 15000) plus API list/sync response schemas.
  • config.ts — markdown file I/O: readAllAgentSkills() parses *.md with the existing front-matter lib; writeAgentSkills() serializes YAML front-matter, skips unchanged files, and deletes local files missing from the remote list.
  • api.tsfetchAgentSkills() and pushAgentSkills(), which reconciles against the remote set (POST new, PUT changed, DELETE remote-only) and returns created/updated/deleted names. It returns early on an empty local list so a project with no skills never wipes remote skills during deploy.
  • resource.ts — implements the standard Resource<AgentSkill> interface (readAll / push).

New CLI commands

  • base44 agent-skills pull — fetches remote skills and syncs them into agentSkillsDir, reporting written/deleted files.
  • base44 agent-skills push — pushes local skills with a destructive-action confirmation (-y/--yes to skip; auto-skipped when non-interactive), matching the agents commands.
  • Both registered in program.ts under a new agent-skills command group.

Project config & deploy

  • New agentSkillsDir config key (defaults to agent-skills); agentSkills added to ProjectResources/ProjectData and loaded in parallel with the other resources (empty for plugin resource sets).
  • deployAll() pushes agent skills immediately before agents; hasResourcesToDeploy() accounts for them.

Agent schema

  • selected_skill_names is now a typed, defaulted ([]) field on AgentConfigSchema. selected_workspace_skill_ids (org-shared workspace skills) still passes through untouched via looseObject.

Template & docs

  • The backend-and-client template ships a weekly-report.md example skill, referenced from task_manager.jsonc.
  • docs/resources.md gains an "Agent skills" section and updated deploy ordering.

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

New/updated tests:

  • tests/cli/agent-skills_pull.spec.ts — empty remote, outside-a-project failure, successful pull, API error, files written to disk, unchanged skills skipped, in-place update, local deletion.
  • tests/cli/agent-skills_push.spec.ts — empty-project guard, outside-a-project failure, create, update + delete reconciliation.
  • tests/core/agent-skills_config.spec.ts — parse, write/read round-trip, deletion, missing directory, invalid name, empty body.
  • tests/core/project.spec.ts, tests/core/agents-schema.spec.ts, tests/core/agents.spec.ts — config loading, invalid skill file, selected_skill_names parsing and defaults.
  • tests/cli/testkit/TestAPIServer.ts — mocks for the agent-skills GET/POST/PUT/DELETE endpoints; new with-agent-skills and invalid-agent-skill fixtures.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated docs/ (AGENTS.md) if I made architectural changes

Additional Notes

No new runtime dependencies — front-matter, yaml, and globby are already bundled (front-matter is also used by core/project/template.ts). Skills are pushed before agents during deploy so agents referencing a skill by name resolve against skills that already exist remotely. Both pull and push reconcile (each deletes entries missing on the other side), which is why push prompts for confirmation and the pull description calls out that it replaces local files.


🤖 Generated by Claude | 2026-07-30 08:31 UTC | 57983f5

yardend-wix and others added 10 commits July 15, 2026 18:33
Export SKILL_NAME_REGEX, AgentSkillApiResponseSchema, ListAgentSkillsResponseSchema,
and SyncAgentSkillsResultSchema (and their inferred types) so they can be used by
Task 2 and other modules. These are part of the public API of the agent-skill module.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds selected_skill_names as a typed, defaulted array on AgentConfigSchema.
selected_workspace_skill_ids remains untyped passthrough via looseObject.
Updates agents.spec.ts fixtures/assertions to account for the new default field.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds `base44 agent-skills pull|push`, registers them in program.ts, and
adds TestAPIServer mocks for the agent-skills reconcile endpoints. Also
fixes deploy/env-token-auth tests that were missing a GET agent-skills
mock now that deploy always reconciles agent skills (pushAgentSkills
fetches remote unconditionally, even for an empty local set).
…mote skills

pushAgentSkills now short-circuits on an empty list (mirrors pushAgents),
so 'base44 deploy' from a project with no local skills no longer reconciles
against remote and deletes them. Reverts the deploy-spec GET mocks that had
masked the missing guard, and adds a unit test asserting the empty push makes
no HTTP calls.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.1.6-pr.575.57983f5

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.1.6-pr.575.57983f5"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.1.6-pr.575.57983f5"
  }
}

Preview published to npm registry — try new features instantly!

@yardend-wix
yardend-wix force-pushed the feat/agent-skills-cli branch from 1cff89f to 3594d8c Compare July 26, 2026 07:05
…d conventions

- add 'successfully' to task success messages (matches agents/connectors/entities)
- 'Manage project agent skills' (matches the 'project' wording used by siblings)
- add '(replaces all remote/local agent skills)' clauses to push/pull descriptions
- drop the dead AgentSkillApiResponse type alias
#573)

Main added confirmPush + -y/--yes to the resource push commands; mirror it on
agent-skills push so it prompts (and requires --yes non-interactively) like agents.
@yardend-wix
yardend-wix force-pushed the feat/agent-skills-cli branch from 4a86148 to 2e3a871 Compare July 28, 2026 10:19
- add agent-skills_pull.spec.ts (mirrors agents_pull: written/skip/update/delete/error)
- add the non-interactive '--yes required' push test (parity with agents/entities/connectors)
- make the push update path real (was a dead mock) and assert Created/Updated/Deleted
- move readProjectConfig skills case into project.spec.ts; add 'throws on invalid agent skill file' + invalid-agent-skill fixture
- add core schema-validation negatives (bad name, empty body) to config spec
- add missing .app.jsonc to the with-agent-skills fixture (testing rule #3)
Comment thread packages/cli/tests/core/agent-skills_deploy.spec.ts Outdated
Comment thread packages/cli/tests/core/project.spec.ts Outdated
Comment thread packages/cli/tests/core/agent-skills_api.spec.ts Outdated
Comment thread packages/cli/src/core/resources/agent-skill/config.ts Outdated
Comment thread packages/cli/src/core/resources/agent-skill/api.ts
netanelgilad
netanelgilad previously approved these changes Jul 30, 2026
…rc-mock tests

- parse skill frontmatter with the existing front-matter dep (+ yaml for
  serialization) instead of a hand-rolled regex; round-trip verified live
  incl. colon/apostrophe descriptions
- remove the two src-mocking unit specs (agent-skills_deploy, agent-skills_api);
  the empty-push guard is now covered by the integration push spec (no mocks
  registered -> any request would 404), reconcile is covered end-to-end there
- assert the error message in the invalid-skill project test
@yardend-wix
yardend-wix merged commit c59d1f4 into main Jul 30, 2026
25 of 26 checks passed
@yardend-wix
yardend-wix deleted the feat/agent-skills-cli branch July 30, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants